//
//  GHBaseTableViewController.swift
//  KYC2C
//
//  Created by Guanghui Liao on 12/15/17.
//  Copyright © 2017 liaoworking. All rights reserved.
//

import UIKit
import DZNEmptyDataSet
class GHBaseTableViewController: GHBaseViewController,UITableViewDelegate,UITableViewDataSource {

    //MARK: -lazy
    
    var dataList:Array<Any> = []
    
    lazy var tableView:UITableView = {() -> UITableView in
        var tableView = UITableView(frame: CGRect(x: 0, y:0, width: K_WIDTH, height: K_HEIGHT), style: .plain)
        tableView.delegate = self
        tableView.dataSource = self
        tableView.separatorStyle = .none
        tableView.emptyDataSetSource = self
        return tableView
    }()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        view.addSubview(tableView)

        // Do any additional setup after loading the view.
    }

    
    //MARK: - tableViewDelegate and dataSource
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return self.dataList.count
    }
  
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        return UITableViewCell()
    }
    

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
}


extension GHBaseTableViewController:DZNEmptyDataSetSource {
    
   public func title(forEmptyDataSet scrollView: UIScrollView!) -> NSAttributedString! {
        
        let MAString = NSAttributedString(string: "暂无数据", attributes: [NSAttributedStringKey.font:UIFont.systemFont(ofSize: 17),NSAttributedStringKey.foregroundColor:UIColor.init(red: 104, green: 164, blue: 237) ?? UIColor.black])
        return MAString
    }
    
    
   public func image(forEmptyDataSet scrollView: UIScrollView!) -> UIImage! {
         return  #imageLiteral(resourceName: "不限次数")
    }
    
}
